import request from '@/utils/request'
import { URL_PREFIX } from '@/api/config'

export default {

  // 查询列表
  getList(data, pageNum, pageSize) {
    return request({
      url: URL_PREFIX + '/flow/model/list',
      method: 'post',
      data: { ...data, pageNum, pageSize }
    })
  },

  // 新增模型
  add(data) {
    return request({
      url: URL_PREFIX + '/flow/model/add',
      method: 'post',
      data
    })
  },

  // 删除模型
  deleteById(id) {
    return request({
      url: URL_PREFIX + `/flow/model/${id}`,
      method: 'delete'
    })
  },

  // 部署发布流程
  deployById(id) {
    return request({
      url: URL_PREFIX + `/flow/model/deploy/${id}`,
      method: 'post'
    })
  }

}

